package com.zhiyou100.day1029springbooot.serviceImpl;

import com.zhiyou100.day1029springbooot.mapper.ITeacherMapper;
import com.zhiyou100.day1029springbooot.pojo.Teacher;
import com.zhiyou100.day1029springbooot.service.ITeacherService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service("teacherService")
public class TeacherServiceImpl implements ITeacherService {
    @Resource
    private ITeacherMapper teacherMapper;
    @Override
    public List<Teacher> queryAll() {
        return teacherMapper.queryAll();
    }

    @Override
    public void add(Teacher teacher) {
        teacherMapper.add(teacher);
    }

    @Override
    public void deleteById(int id) {
    teacherMapper.deleteById(id);
    }

    @Override
    public Teacher findById(int id) {
        return teacherMapper.findById(id);
    }

    @Override
    public int update(Teacher teacher) {
        teacherMapper.update(teacher);
        return 0;
    }
}
